<?php
//$convert="/usr/bin/convert";
$convert="/data/cloud/qin/1/usr/bin/convert";
			  $src=$_REQUEST["src"];
			  $dir="/data/cloud/qin/1/logs/";
			  $dst = "${dir}a.txt";

			  system("touch ");
			  $out="${dir}c.jpg";//dirname(__FILE__)."/../logs/c.jpg";
			  $cmd = "$convert -resize 30%x30% $src $out >$dst 2>&1";
			  //print $cmd."<br/>";
			  exec($cmd, $str, $rc);
			  //print_r($str);
			  //print $rc;
			  if (file_exists($out))
			    {
			      /* print "file exists"; */
			      $cnt=file_get_contents($out);
			      //$cnt = addslashes($img);
			      ob_clean();
			      header("Content-type: image/jpeg");
			      echo $cnt;
			    }
			  else
			    {
			      echo "$out not exists";
			    }
